from selenium.webdriver.common.by import By

from base import Base
class Page(Base):
    # ANDROID_UIAUTOMATOR定位方法
    def sou(self):
        loc=(By.ANDROID_UIAUTOMATOR,'new UiSelector().text("搜商品名称 作者 出版社 ISBN")')
        ele=self.find_ele(loc)
        return ele
    # CLASS_NAME定位方法
    def shu(self):
        loc=(By.CLASS_NAME,'android.widget.EditText')
        ele = self.find_ele(loc)
        return ele
    # ID定位方法
    def dian(self):
        loc=(By.ID,'com.kongfz.app:id/tvSearch')
        ele = self.find_ele(loc)
        return ele
    # XPATH定位方法
    def dian2(self):
        loc=(By.XPATH,'(//android.widget.ImageView[@resource-id="com.kongfz.app:id/ivPic"])[7]')
        ele = self.find_ele(loc)
        return ele
    def duan(self):
        loc=(By.XPATH,'//android.widget.TextView[@text="店铺"]')
        ele = self.find_ele(loc)
        return ele